#pragma GCC optimize(2)
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>

using namespace std;
using LL = long long;
const int N = 1e5 + 10;

int n, q;
int a[N];


int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n;
    for(int i = 1; i <= n; i ++) cin >> a[i];
    cin >> q;
    int op, k, x;
    while(q--){
        cin >> op;
        if(op == 1){
            cin >> k >> x;
            a[k] = x;
        }else{
            cin >> k;
            cout << a[k] << '\n';
        }
    }


    return 0;
}